var t = getApp();

Page({
    data: {
        language: "",
        total_income: 0,
        income: 0,
        plugs: []
    },
    onLoad: function(t) {
        this.getData();
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, e = t.getNetAddresss("finance.earning.earning-count");
        t._getNetWork({
            url: e,
            success: function(t) {
                var e = t.data;
                1 == e.result && a.setData({
                    total_income: e.data.total.grand_total,
                    income: e.data.total.can_withdraw,
                    plugs: e.data.data
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    gotoIncome: function() {
        var a = t.getNetAddresss("member.member.withdrawByMobile");
        t._getNetWork({
            url: a,
            success: function(t) {
                var a = t.data;
                1 == a.result ? 1 == a.data.is_bind_mobile ? wx.navigateTo({
                    url: "/packageA/member/withdrawEditmobile/withdrawEditmobile"
                }) : wx.navigateTo({
                    url: "/packageA/member/withdrawal/withdrawal"
                }) : wx.showToast({
                    title: a.data.msg,
                    icon: "none",
                    duration: 2e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    gopresentationRecord: function() {
        wx.navigateTo({
            url: "/packageA/member/presentationRecord_v2/presentationRecord_v2?orderType=extension"
        });
    }
});